export default {
    loginMock: options => {
        // console.log(options);
        let { name, pwd } = JSON.parse(options.body);
        let token = ''; //后台创建的token，身份的令牌相当于
        let role = '';
        if (name == 'admin' && pwd == '123456') {
            return {
                code: 200,
                msg: '请求成功',
                data: {
                    token: 'token-admin-123456',
                    role: '管理员',
                },
            };
        } else if (name == 'user' && pwd == '123456') {
            return {
                code: 200,
                msg: '请求成功',
                data: {
                    token: 'token-admin-123456',
                    role: '普通用户',
                },
            };
        } else {
            return {
                code: 500,
                msg: '账号或者密码不存在',
                data: null,
            };
        }
    },
};
